package entities

import "gitee.com/igolang/pkg/xgin/xvalidator"

type JobLogPageListReq struct {
	PageListReq
	JobName  string `json:"jobName"`
	JobGroup string `json:"jobGroup"`
}

type JobPageListReq struct {
	PageListReq
	JobName  string `json:"jobName"`
	JobGroup string `json:"jobGroup"`
}

type JobSaveReq struct {
	JobId        int64  `json:"jobId"`
	Concurrent   int64  `json:"concurrent"`
	Expression   string `json:"cronExpression" binding:"required" validator_msg:"cron表达式不能为空"`
	InvokeTarget string `json:"invokeTarget" binding:"required" validator_msg:"目标字符串不能为空"`
	JobGroup     string `json:"jobGroup"`
	JobName      string `json:"jobName" binding:"required" validator_msg:"任务名称不能为空"`
	Status       string `json:"status"`
	Remark       string `json:"remark"`
}

func (e *JobSaveReq) FormatErr(err error) error {
	return xvalidator.FormatError(e, err)
}
